<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 800px;
            height: 150px;
            margin: 10px;
        }
        .box{
            width: 800px;
            height: 150px;
            /* 基于webkit内核的实现 */
            background: -webkit-gradient(liner,left top,left bottom,from(red),to(blue));
            /* 基于Gecko内核的实现 */
            background: -moz-linear-gradient(left,red,blue);
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>